package bancosys.tec.persist;

import jmine.tec.annotations.Unmodifiable;
import bancosys.tec.persist.entities.domain.Mov;
import bancosys.tec.persist.persister.listener.AbstractActionAwarePersisterListener;

@Unmodifiable
public class MovPersisterListener extends AbstractActionAwarePersisterListener<Mov> {

    /**
     * {@inheritDoc}
     */
    @Override
    public void beforeInsert(Mov bean, Object action) {
        this.onAction(bean, action);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void beforeUpdate(Mov bean, Object action) {
        this.onAction(bean, action);
    }

    /**
     * Efetua a ação
     * 
     * @param bean bean
     * @param action action
     */
    private void onAction(Mov bean, Object action) {
        bean.setTeste((String) action);
    }
}
